import { lazy } from "react";
import {
    AppOutline,
    AppstoreOutline,
    MessageOutline,
    UserContactOutline
} from 'antd-mobile-icons'

const Index = lazy(()=>import('../pages/index'))
const Classify = lazy(()=>import('../pages/classify'))
const Message = lazy(()=>import('../pages/message'))
const User = lazy(()=>import('../pages/user'))
const Home = lazy(()=>import('../pages/home'))
const Login = lazy(()=>import('../pages/login'))
const Register = lazy(()=>import('../pages/register'))
const List = lazy(()=>import('../pages/list'))
const Detail = lazy(()=>import('../pages/detail'))
const Error = lazy(()=>import('../pages/404'))
const Ticksonper = lazy(()=>import('../pages/ticksonper'))

export let homeRouters = [
    {
        path: '/',
        element: <Index></Index>,
        title: '首页',
        icon: <AppOutline />
    },
    {
        path: '/classify',
        element: <Classify></Classify>,
        title: '分类',
        icon: <AppstoreOutline />
    },
    {
        path: '/message',
        element: <Message></Message>,
        title: '消息',
        icon: <MessageOutline />
    },
    {
        path: '/user',
        element: <User></User>,
        title: '我的',
        icon: <UserContactOutline />
    },
]

export let routers = [
    {
        path:'/',
        element:<Home></Home>,
        children:homeRouters
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'/register',
        element:<Register></Register>
    },
    {
        path:'/list',
        element:<List></List>
    },
    {
        path:'/detail',
        element:<Detail></Detail>
    },
    {
        path:'/ticksonper',
        element:<Ticksonper></Ticksonper>
    },
    {
        path:'*',
        element:<Error></Error>
    },
]